package ee.serge.service;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import ee.serge.shared.Feedback;
import ee.serge.shared.HandledException;
import ee.serge.shared.Loan;

@RemoteServiceRelativePath("public")
public interface PublicService extends RemoteService {

   /**
    * Tagastab kõik aktiivsed laenud.
    */
   List<Loan> getLoans() throws HandledException;
   
   /**
    * Tagastab laenu koos kõigi andmetega (lõpmatu sügavus)
    */
   Loan getLoan(long id) throws HandledException;
   
   void addFeedback(Feedback feedback, String challenge, String response) throws HandledException;
   
   boolean verifyChallenge(String challenge, String response);
   
   List<Feedback> getFeedbackList(String loanKey) throws HandledException;

   
}
